package org.baicaix.worms.display.camera {
	import com.greensock.TweenLite;
	import flash.display.Sprite;

	/**
	 * 镜头类
	 * @author baicaix
	 * 2010-9-9
	 */
	public class Camera {

		private static var _stage : Sprite;

		public static function init(stage : Sprite) : void {
			_stage = stage;
			pos(stage.stage.stageWidth / 2, stage.stage.stageHeight / 2);
		}

		
		public static function pos(x : Number, y : Number) : void {
			var targetX : Number = _stage.stage.stageWidth / 2 - x;
			var targetY : Number = _stage.stage.stageHeight / 2 - y;
			
			TweenLite.to(_stage, 1, {x : targetX, y : targetY});
		}
	}
}
